package com.wanmait.employment.manageController;

import com.wanmait.employment.entity.RecruitmentEducation;
import com.wanmait.employment.service.RecruitmentEducationService;
import com.wanmait.employment.util.AjaxResult;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;


/**
 *
 */
@RestController
@RequestMapping("/manage/RecruitmentEducation")
public class RecruitmentEducationController {

    @Resource
    private RecruitmentEducationService recruitmentEducationService;
    @GetMapping("list")
    public AjaxResult list(String title){
       List<RecruitmentEducation> recruitmentEducations= recruitmentEducationService.selectList(title);
        return AjaxResult.success("",recruitmentEducations);
    }

    @PostMapping("update")
    public AjaxResult update(@RequestBody RecruitmentEducation recruitmentEducation){
        if(recruitmentEducation.getId()!=null){
            recruitmentEducationService.update(recruitmentEducation);
            return AjaxResult.success("");
        }
        recruitmentEducationService.insert(recruitmentEducation);
        return AjaxResult.success("");
    }
    @GetMapping("delete")
    public AjaxResult delete(Integer id){
        recruitmentEducationService.delete(id);
        return AjaxResult.success("");
    }
}
